package pages.navigator;

import pages.*;
import selenium.WebDriverWrapper;

/**
 * Created by Olga on 10.06.2014.
 */
public class PageNavigator {
    public static BasePage openPage(PageList page, WebDriverWrapper driver) throws Exception {
        switch (page) {
            case NOTEBOOKS:
                Notebooks computersPage = new Notebooks(driver);
                computersPage.open();
                return computersPage;
            case PHONES:
                Mobile phonesPage = new Mobile(driver);
                phonesPage.open();
                return phonesPage;
            case CAR:
                Car carPage = new Car(driver);
                carPage.open();
                return carPage;
            case TOURISM:
                Tourism tourismPage = new Tourism(driver);
                tourismPage.open();
                return tourismPage;
            case BT:
                Bt btPage = new Bt(driver);
                btPage.open();
                return btPage;
            case CHILD:
                Children childPage = new Children(driver);
                childPage.open();
                return childPage;
            case HOUSE:
                House housePage = new House(driver);
                housePage.open();
                return housePage;
            case TICKETS:
                Tickets ticketPage = new Tickets(driver);
                ticketPage.open();
                return ticketPage;
            case TV:
                Tv tvPage = new Tv(driver);
                tvPage.open();
                return tvPage;
            case SHOES:
                Shoes shoesPage = new Shoes(driver);
                shoesPage.open();
                return shoesPage;
            default:
                throw new Exception();
        }
    }
}
